package com.justplay.mobilelocation.util;

import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.justplay.mobilelocation.UI.SoftwarAccreditCodeActivity;

/**
 * Created by heyue on 2017/5/11.
 */

public class InputActivityUtil {
    public static void gotoInputCodeActivity(final Context context) {
//        AlertDialog.Builder builder = new AlertDialog.Builder(context);
//        builder.setMessage("请输入软件授权码").setPositiveButton("确定", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//                context.startActivity(new Intent(context, SoftwarAccreditCodeActivity.class));
//
//            }
//        }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//
//            }
//        });
//        builder.setCancelable(false);
//
//        return builder.create();
        Boolean havedBuy = SharePreferencesUtil.getBoolean("havedBuy", false, context);
        if (havedBuy) {
            Toast.makeText(context, "网络未开通", Toast.LENGTH_SHORT).show();
        } else {
            context.startActivity(new Intent(context, SoftwarAccreditCodeActivity.class));
        }

    }
}
